package com.suray.rgv60.util;

/**
 * 手动行驶类型
 */
public enum ManualMoveType {
    INVALID(-1, "无效"),
    INIT(0, "初始化"),
    FORWARD(1, "前进"),
    FALL_BACK(2, "后退"),
    TURN_LEFT(3, "左转"),
    TURN_RIGHT(4, "右转"),
    STOP_MOVE(0xFF, "停止"),
    ;

    int value;
    String des;
    ManualMoveType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static ManualMoveType parseType(int value) {
        for (ManualMoveType manualMoveType : ManualMoveType.values()) {
            if (manualMoveType.value == value) {
                return manualMoveType;
            }
        }

        return INVALID;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return des;
    }
}
